VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form achive 
   Caption         =   "Yearly Achivement"
   ClientHeight    =   10485
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   15240
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   11010
   ScaleWidth      =   20280
   WindowState     =   2  'Maximized
   Begin VB.PictureBox Picture2 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000008&
      Height          =   735
      Left            =   6360
      ScaleHeight     =   705
      ScaleWidth      =   10905
      TabIndex        =   12
      Top             =   1815
      Width           =   10935
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         Caption         =   "Employees' Yearly Achivement"
         BeginProperty Font 
            Name            =   "Palatino Linotype"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2400
         TabIndex        =   13
         Top             =   120
         Width           =   6255
      End
   End
   Begin VB.PictureBox Picture3 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000008&
      Height          =   6735
      Left            =   2760
      ScaleHeight     =   6705
      ScaleWidth      =   2985
      TabIndex        =   8
      Top             =   1815
      Width           =   3015
      Begin VB.CommandButton Command3 
         Caption         =   "Move To Next Level"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   480
         TabIndex        =   10
         Top             =   6120
         Width           =   1935
      End
      Begin VB.ListBox List1 
         Height          =   4785
         ItemData        =   "achive.frx":0000
         Left            =   240
         List            =   "achive.frx":0002
         Style           =   1  'Checkbox
         TabIndex        =   9
         Top             =   960
         Width           =   2535
      End
      Begin VB.Label Label3 
         Caption         =   "Manual Promotion List"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   480
         TabIndex        =   11
         Top             =   480
         Width           =   2055
      End
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Move To Next Level"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   15360
      TabIndex        =   5
      Top             =   8640
      Width           =   1935
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   5295
      Left            =   6360
      TabIndex        =   4
      Top             =   3255
      Width           =   10935
      _ExtentX        =   19288
      _ExtentY        =   9340
      _Version        =   393216
      Cols            =   5
      BackColor       =   -2147483634
      BackColorBkg    =   -2147483633
      Appearance      =   0
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000008&
      Height          =   975
      Left            =   6360
      ScaleHeight     =   945
      ScaleWidth      =   10905
      TabIndex        =   0
      Top             =   2415
      Width           =   10935
      Begin VB.ComboBox Combo1 
         Height          =   315
         Left            =   7320
         TabIndex        =   6
         Top             =   240
         Width           =   1815
      End
      Begin VB.CommandButton Command1 
         Caption         =   "Achive"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   9480
         TabIndex        =   3
         Top             =   240
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         Height          =   375
         Left            =   3120
         TabIndex        =   2
         Top             =   240
         Width           =   1935
      End
      Begin VB.Label Label4 
         Caption         =   "Select Designation"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5520
         TabIndex        =   7
         Top             =   270
         Width           =   1695
      End
      Begin VB.Label Label1 
         Caption         =   "Enter the Amount"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   300
         Width           =   3495
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   9120
      Top             =   7215
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Image Image1 
      Height          =   840
      Left            =   8400
      Picture         =   "achive.frx":0004
      Stretch         =   -1  'True
      Top             =   120
      Width           =   960
   End
   Begin VB.Label Label15 
      Caption         =   "JEEVAN VAISYA GREEN AGROTECH LLP"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   9360
      TabIndex        =   15
      Top             =   435
      Width           =   5895
   End
   Begin VB.Label Label16 
      Caption         =   "EMPLOYEES' PROMOTION FORM"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   10800
      TabIndex        =   14
      Top             =   915
      Width           =   3015
   End
End
Attribute VB_Name = "achive"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim c As Connection
Dim rs, rs1, rs2, rs3 As Recordset

Private Sub Combo1_DropDown()
Combo1.Clear
Combo1.AddItem "CED"
Combo1.AddItem "DA-III"
Combo1.AddItem "DA-II"
Combo1.AddItem "DA-I"
Combo1.AddItem "DA"
Combo1.AddItem "RDM"
Combo1.AddItem "ADM"
Combo1.AddItem "DM"
Combo1.AddItem "Agent"
End Sub
Private Sub Command1_Click()
MSFlexGrid1.Clear
List1.Clear
Call database
MSFlexGrid1.TextMatrix(0, 0) = "S.No"
MSFlexGrid1.TextMatrix(0, 1) = "Name"
MSFlexGrid1.TextMatrix(0, 2) = "Position"
MSFlexGrid1.TextMatrix(0, 3) = "CodeNo"
MSFlexGrid1.TextMatrix(0, 4) = "Amount"
j = 1
MSFlexGrid1.Rows = rs.RecordCount + 1
If Not rs.EOF Then rs.MoveFirst
For i = 1 To rs.RecordCount
If StrComp(rs!Pos, Combo1.Text) = 0 Then
MSFlexGrid1.TextMatrix(j, 0) = j
MSFlexGrid1.TextMatrix(j, 1) = rs.Fields(0)
MSFlexGrid1.TextMatrix(j, 2) = rs.Fields(1)
MSFlexGrid1.TextMatrix(j, 3) = rs.Fields(2)
MSFlexGrid1.TextMatrix(j, 4) = rs.Fields(4)
j = j + 1
End If
rs.MoveNext
Next i
Call database2
rs2.Close
Command2.Enabled = True
Command3.Enabled = True
End Sub
Private Sub Command2_Click()
Call database
For i = 1 To rs.RecordCount
If StrComp(rs!Pos, Combo1.Text) = 0 Then
rs!Pos = Switch(rs.Fields(1) = "CED", "LEFT", rs.Fields(1) = "DA-III", "CED", rs.Fields(1) = "DA-II", "DA-III", rs.Fields(1) = "DA-I", "DA-II", rs.Fields(1) = "DA", "DA-I", rs.Fields(1) = "RDM", "DA", rs.Fields(1) = "ADM", "RDM", rs.Fields(1) = "DM", "ADM", rs.Fields(1) = "Agent", "DM")
Call database1(rs!Pos, rs!INTRONO)
rs.Update
End If
rs.MoveNext
Next i
Command2.Enabled = False
Call database3
End Sub

Private Sub Command3_Click()
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then
Set rs = New Recordset
rs.CursorLocation = adUseServer
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.Open "select * from AgentInfo where CodeNo='" & List1.List(i) & "'", c
rs!Pos = Switch(rs.Fields(1) = "CED", "LEFT", rs.Fields(1) = "DA-III", "CED", rs.Fields(1) = "DA-II", "DA-III", rs.Fields(1) = "DA-I", "DA-II", rs.Fields(1) = "DA", "DA-I", rs.Fields(1) = "RDM", "DA", rs.Fields(1) = "ADM", "RDM", rs.Fields(1) = "DM", "ADM", rs.Fields(1) = "Agent", "DM")
Call database1(rs!Pos, rs!INTRONO)
rs.Update
End If
Next i
Command3.Enabled = False
Call database3
End Sub

Private Sub Form_Load()
MSFlexGrid1.ColWidth(1) = 3800
MSFlexGrid1.ColWidth(2) = 2080
MSFlexGrid1.ColWidth(3) = 2050
MSFlexGrid1.ColWidth(4) = 2000
MSFlexGrid1.FixedCols = 0
MSFlexGrid1.TextMatrix(0, 0) = "S.No"
MSFlexGrid1.TextMatrix(0, 1) = "Name"
MSFlexGrid1.TextMatrix(0, 2) = "Position"
MSFlexGrid1.TextMatrix(0, 3) = "CodeNo"
MSFlexGrid1.TextMatrix(0, 4) = "Amount"
Set c = New Connection
c.Provider = "Microsoft.Jet.OLEDB.4.0"
c.Open App.Path & "\jeevan.mdb"
End Sub
Private Sub database()
Dim l As Integer
Set rs = New Recordset
rs.CursorLocation = adUseServer
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
l = Val(Text1)
rs.Open "select * from AgentInfo where Pos='" & Combo1.Text & "' and Perform>=" & l, c
End Sub

Private Function database1(s As String, code As String)
Set rs1 = New Recordset
rs1.CursorLocation = adUseServer
rs1.CursorType = adOpenKeyset
rs1.LockType = adLockOptimistic
rs1.Open "select * from AgentInfo where CodeNo='" & code & "'", c
If Not rs1.EOF Then
If rs1!Pos = s Then rs!INTRONO = rs1!INTRONO
End If
End Function

Private Sub database2()
Set rs2 = New Recordset
rs2.CursorLocation = adUseServer
rs2.CursorType = adOpenKeyset
rs2.LockType = adLockOptimistic
rs2.Open "select * from AgentInfo where pos='" & Combo1.Text & "'", c
If Not rs2.EOF Then rs2.MoveFirst
While Not rs2.EOF
List1.AddItem rs2!CodeNo
rs2.MoveNext
Wend
End Sub
Private Sub database3()
Set rs2 = New Recordset
rs2.CursorLocation = adUseServer
rs2.CursorType = adOpenKeyset
rs2.LockType = adLockOptimistic
rs2.Open "select * from AgentInfo", c
Set rs3 = New Recordset
rs3.CursorLocation = adUseServer
rs3.CursorType = adOpenKeyset
rs3.LockType = adLockOptimistic
rs3.Open "select * from salary", c
rs2.MoveFirst
rs3.MoveFirst
While Not rs2.EOF
rs3!Pos = rs2!Pos
rs3!CodeNo = rs2!CodeNo
rs3!IntroCode = rs2!INTRONO
rs2.MoveNext
rs3.MoveNext
Wend
End Sub


